package cn.springcloud.alibaba.core.base;

import lombok.Getter;

@Getter
public enum ResultCode {

	OK(0, "OK"),
	RESULT_INVALID_PARA(400, "invalid parameter"),
	RESULT_LOGIN_EXPIRED(401, "login expired"),
	FORBIDDEN(403, "Forbidden"),
	RESULT_DATA_NOTFOUND(404, "data not found"),
	CONFLICT(409, "Conflict"),

	RESULT_SYSTEM_ERROR(500, "system error!"),

	CLIENT_AUTHENTICATION_FAILED(1001, "客户端认证失败"),
	USERNAME_OR_PASSWORD_ERROR(1002, "用户名或密码错误"),
	UNSUPPORTED_GRANT_TYPE(1003, "不支持的认证模式"),
	NO_PERMISSION(1004, "无权限访问"),
	INVALID_TOKEN(1005, "无效的token"),
	;

	private final int code;
	private final String message;

	ResultCode(int code, String message) {
		this.code = code;
		this.message = message;
	}
}
